import request from "@/utils/request";

export function getTasks(userId: any, deviceId: any) {
  return request({
    url: "/task",
    method: "get",
    params: {
      userId,
      deviceId,
    },
  });
}

export function getTask(id: any) {
  return request({
    url: `/task/${id}`,
    method: "get",
  });
}

export function addTask(data: any) {
  return request({
    url: "/task",
    method: "post",
    data,
  });
}

export function editTask(id: any, data: any) {
  return request({
    url: `/task/${id}`,
    method: "put",
    data,
  });
}

export function deleteTask(code: any) {
  return request({
    url: `/task/${code}`,
    method: "delete",
  });
}
